package com.dingding.facade.special.trasfer.place;

import java.io.Serializable;
import java.util.Date;

import com.dingding.common.core.beans.special.UserspecialorderT;
import com.dingding.common.core.util.paravalidate.CanNull;

/**
 * @Description:后台下专车单的请求bean
 * @author fengshuonan
 * @date 2016年9月13日 下午3:35:35
 * @version 叮叮搭车
 * @since 2.4
 */
@SuppressWarnings("serial")
public class ReqBackstagePlace implements Serializable{
	
	private String departmentKey;		//旅游公司的id
	private String operatorId;			//旅游公司的操作人员的id
	
	private String cusTeleInput;		//乘客的电话
	private String choosedType;			//选择地址的类型(start or end)(填写的是出发地或者是目的地)
	private String choosedPlace;		//所填的地址
	private Double choosedLatitude;		//所填纬度
	private Double choosedLongitude;	//所填经度
	
	@CanNull
	private String startAddrSelectInput;//所选的出发地(旅行路线的id)
	
	@CanNull
	private String endAddrSelectInput;	//所选的目的地(旅行路线的id)
	private Integer realSelect;			//是否是预约单(1:实时  2:预约)
	
	@CanNull
	private Date orderTime;				//预约时间(如果是预约单)
	
	/**
	 * @Description:生成测试数据
	 * @author fengshuonan
	 * @since 2.4
	 */
	public ReqBackstagePlace generateTest(){
		this.departmentKey = "1";			//旅游公司的id
		this.operatorId = "test";			//旅游公司的操作人员的id
		this.cusTeleInput = "18880100010";	//乘客的电话
		this.choosedType = "start";			//选择地址的类型(start or end)(填写的是出发地或者是目的地)
		this.choosedPlace = "秦始皇兵马俑";	//所填的地址
		this.choosedLatitude = 34.394395;	//所填纬度
		this.choosedLongitude = 109.291943;	//所填经度
		this.startAddrSelectInput = "";		//所选的出发地(旅行路线的id)
		this.endAddrSelectInput = "2";		//所选的目的地(旅行路线的id)
		this.realSelect = 1;				//是否是预约单(1:实时  2:预约)
		this.orderTime = new Date();		//预约时间(如果是预约单)
		return this;
	}
	
	/**
	 * @Description:把这些信息转化成订单临时表的信息，并返回订单临时表
	 * @author fengshuonan
	 * @return UserspecialorderT 订单临时表
	 * @since 2.4
	 */
	public UserspecialorderT toUserSpecialOrderT(UserspecialorderT userspecialorderT){
		if(userspecialorderT == null){
			userspecialorderT = new UserspecialorderT();
		}
		userspecialorderT.setDepId(this.getDepartmentKey());
		if(this.choosedType.equals("start")){
			userspecialorderT.setStartAddress(this.choosedPlace);
			userspecialorderT.setStartLatitude(this.choosedLatitude);
			userspecialorderT.setStartLongitude(this.choosedLongitude);
			userspecialorderT.setRouteId(this.endAddrSelectInput);
		}else{
			userspecialorderT.setEndAddress(this.choosedPlace);
			userspecialorderT.setEndLatitude(this.choosedLatitude);
			userspecialorderT.setEndLongitude(this.choosedLongitude);
			userspecialorderT.setRouteId(this.startAddrSelectInput);
		}
		userspecialorderT.setSetOutType(this.realSelect);
		if(realSelect == 2){//如果是预约单
			userspecialorderT.setSetOutTime(this.orderTime);
		}
		userspecialorderT.setOperatorId(this.operatorId);
		return userspecialorderT;
	}
	
	public String getDepartmentKey() {
		return departmentKey;
	}
	public void setDepartmentKey(String departmentKey) {
		this.departmentKey = departmentKey;
	}
	public String getCusTeleInput() {
		return cusTeleInput;
	}
	public void setCusTeleInput(String cusTeleInput) {
		this.cusTeleInput = cusTeleInput;
	}
	public String getChoosedType() {
		return choosedType;
	}
	public void setChoosedType(String choosedType) {
		this.choosedType = choosedType;
	}
	public String getChoosedPlace() {
		return choosedPlace;
	}
	public void setChoosedPlace(String choosedPlace) {
		this.choosedPlace = choosedPlace;
	}
	public Double getChoosedLatitude() {
		return choosedLatitude;
	}
	public void setChoosedLatitude(Double choosedLatitude) {
		this.choosedLatitude = choosedLatitude;
	}
	public Double getChoosedLongitude() {
		return choosedLongitude;
	}
	public void setChoosedLongitude(Double choosedLongitude) {
		this.choosedLongitude = choosedLongitude;
	}
	public String getStartAddrSelectInput() {
		return startAddrSelectInput;
	}
	public void setStartAddrSelectInput(String startAddrSelectInput) {
		this.startAddrSelectInput = startAddrSelectInput;
	}
	public String getEndAddrSelectInput() {
		return endAddrSelectInput;
	}
	public void setEndAddrSelectInput(String endAddrSelectInput) {
		this.endAddrSelectInput = endAddrSelectInput;
	}
	public Integer getRealSelect() {
		return realSelect;
	}
	public void setRealSelect(Integer realSelect) {
		this.realSelect = realSelect;
	}
	public Date getOrderTime() {
		return orderTime;
	}
	public void setOrderTime(Date orderTime) {
		this.orderTime = orderTime;
	}

	public String getOperatorId() {
		return operatorId;
	}

	public void setOperatorId(String operatorId) {
		this.operatorId = operatorId;
	}

	@Override
	public String toString() {
		return "ReqBackstagePlace [departmentKey=" + departmentKey + ", operatorId=" + operatorId + ", cusTeleInput="
				+ cusTeleInput + ", choosedType=" + choosedType + ", choosedPlace=" + choosedPlace
				+ ", choosedLatitude=" + choosedLatitude + ", choosedLongitude=" + choosedLongitude
				+ ", startAddrSelectInput=" + startAddrSelectInput + ", endAddrSelectInput=" + endAddrSelectInput
				+ ", realSelect=" + realSelect + ", orderTime=" + orderTime + "]";
	}
}

